﻿<link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/select/css/demo.css")">
<script src="@Url.Content("~/Content/select/js/demo.js")"></script>

<!-- grade -->
<div class="grade-w-roll meishi22" id="ss">
    <ul class="meishia-w" id="meishia">
        <li v-for="c in colleges">
            <span id="c.id" name="c.name" v-on:click="selectc">{{c.name}}</span>
        </li>
    </ul>
</div>

<input type="hidden" id="hidForSchool" value="@ViewBag.school"/>


<script type="text/javascript">
    $(function () {
        $('.choosebox li a').click(function () {
            var thisToggle = $(this).is('.size_radioToggle') ? $(this) : $(this).prev();
            var checkBox = thisToggle.prev();
            checkBox.trigger('click');
            $('.size_radioToggle').removeClass('current');
            thisToggle.addClass('current');
            return false;
        });
    });

    $(".choosebox li a").click(function () {
        var text = $(this).html();
        $(".choosetext span").html(text);
        $("#result").html("" + getSelectedValue("dress-size"));
    });

    function getSelectedValue(id) {
        $("#" + id).find(".choosetext span.value").html();
    }
</script>


<script type="text/javascript">
    var selectMod = new Vue({
        el: "#ss",
        data: {
         colleges:[]//院系
        }

    });

    $(function () {
        var school = $("#hidForSchool").val();
        var url = apidomian() + "/school/get_brief_info?city=" + school;
        var schools = [];
        axios.get(url)
            .then(function (response) {
                var list = response.data.school_list;
                $.each(list, function (index, value) {
                    var m = {
                        id: value.id,
                        name:value.name
                    }
                    schools.push(m);
                });
                selectMod.schools = schools;
            })
             .catch(function (error) {
                 console.log(error);
             });
    });
    //点击省份
    function selectp(wbj) {
        var arr = document.getElementById("meishia").getElementsByTagName("li");
        for (var i = 0; i < arr.length; i++) {
            var a = arr[i];
            a.style.background = "";
        };
        wbj.style.background = "#eee";
        var p = $(wbj).text().trim();
        $.getJSON("@Url.Content("~/Content/data/pc.json")", function (result) {
            var pro = result[p];
            selectMod.citys = pro;
        });
        //显示二级菜单
        $(".meishia-t")
            .css("left", "25%");
    }

    function selectc(tbj) {
        var arr = document.getElementById("meishib").getElementsByTagName("li");
        for (var i = 0; i < arr.length; i++) {
            var a = arr[i];
            a.style.background = "#eee";
        };
        tbj.style.background = "#fff";

        $(".meishia-s")
          .css("left", "50%");
    }


</script>
